with Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;
with TJa.Calendar;
use TJa.Calendar;
with TJa.Sockets;
use TJa.Sockets;

package body Message is


   procedure Send_Message(Socket : in out Socket_Type; Header : in out Unbounded_String;
                  Text : in out Unbounded_String) is
      TimeDate : Date_And_Time_Type;
      Time : Time_Type;
      TimeString : Unbounded_String;
      TextToSend : Unbounded_String;

   begin
      Clock(TimeDate);
      Time := Get_Time(TimeDate);
      TimeString := To_Unbounded_String(Time);
      TextToSend := TimeString & " "  & Header & " " &  Text;

      TJa.Sockets.Put_Line(Socket, To_String(TextToSend));
   end Send_Message;

     procedure Recieve_Message(Text : in out Unbounded_String) is

      TimeDate : Date_And_Time_Type;
      Time : Time_Type;
 --     TimeString : Unbounded_String;
 --     TextToSend : Unbounded_String;

   begin
      Clock(TimeDate);
      Time := Get_Time(TimeDate);
   --   TimeString := To_Unbounded_String(Time);
   --   TextToSend := TimeString & " "  & Header & " " &  Text;

--      TJa.Sockets.Put_Line(Socket, To_String(TextToSend));
   end Recieve_Message;


end Message;
